package com.student_system.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.student_system.system.entity.SysMenu;
import com.student_system.system.mapper.SysMenuMapper;
import com.student_system.system.service.ISysMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ljy
 * @since 2025-05-14
 */
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService {
    @Autowired
    SysMenuMapper sysMenuMapper;

    @Override
    public Page<SysMenu> queryMenuPage(Page<SysMenu> page, String menuName) {
        LambdaQueryWrapper<SysMenu> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotBlank(menuName)) {
            queryWrapper.like(SysMenu::getMenuName, menuName);
        }
        return this.page(page, queryWrapper);
    }
}
